<!DOCTYPE html>
<html style="height: 100%">
	<head>
		<link data-inline="yes-please" href="./spinner.css" rel="stylesheet" />

		<link
			data-name="vs/editor/editor.main"
			rel="stylesheet"
			href="../../release/dev/vs/editor/editor.main.css"
		/>

		<style type="text/css">
			body {
				margin: 0;
				padding: 0;
				border: 0;
				overflow: hidden;
			}
		</style>
	</head>
	<body>
		<div id="loading">
			<div class="spinner">
				<div class="rect1"></div>
				<div class="rect2"></div>
				<div class="rect3"></div>
				<div class="rect4"></div>
				<div class="rect5"></div>
			</div>
		</div>

		<script>
			var require = { paths: { vs: '../../release/dev/vs' } };
		</script>
		<script src="../../release/dev/vs/loader.js"></script>
		<script src="../../release/dev/vs/editor/editor.main.nls.js"></script>
		<script src="../../release/dev/vs/editor/editor.main.js"></script>

		<script type="text/javascript">
			var receivedCall = null;
			window.load = function (js, html, css) {
				receivedCall = {
					js: js,
					html: html,
					css: css
				};
			};
		</script>

		<script type="text/javascript">
			var geval = eval;

			require(['require', 'vs/editor/editor.main'], function (require) {
				'use strict';

				var loading = document.getElementById('loading');
				loading.parentNode.removeChild(loading);
				document.body.style.height = '100%';

				// Switch `automaticLayout` property to true by default
				//TODO: var config = require('vs/editor/common/config/config');
				//config.getActiveEditor().automaticLayout = true;

				window.load = function (js, html, css) {
					if (css) {
						var style = document.createElement('style');
						style.type = 'text/css';
						style.innerHTML = css;
						document.body.appendChild(style);
					}
					if (html) {
						document.body.innerHTML += html;
					}
					if (js) {
						try {
							geval(js);
						} catch (err) {
							var pre = document.createElement('pre');
							pre.appendChild(document.createTextNode(err));
							document.body.insertBefore(pre, document.body.firstChild);
						}
					}
				};

				if (receivedCall) {
					window.load(receivedCall.js, receivedCall.html, receivedCall.css);
				}
			});
		</script>
	</body>
</html>
